﻿using AdvanceTeam.Event;
using PluginAPI.Core;
using PluginAPI.Core.Attributes;
using PluginAPI.Enums;
using PluginAPI.Events;


namespace AdvanceTeam.Main
{
    public class CodeLoad
    {
        public static CodeLoad Singleton { get; set; }

        [PluginConfig] public Config Config;



        public ReferenceHub AudioHub { get; set; }
        public bool IsReadyContain { get; internal set; }
        public uint Current { get; set; }

        [PluginEntryPoint("04 先遣队支援", "v1.0.0", "先遣队支援", "River")]
        [PluginPriority(LoadPriority.Medium)]
        public void Load()
        {
            if (!this.Config.IsEnable) return;

            Singleton = this;
            Log.Info($"NWPluginAPI| 先遣队支援 | 加载");

            EventManager.RegisterEvents<RoundStartTeamEvent>(this.Config.RoundStartTeamEvent.IsEnabled);
        }

        [PluginUnload]
        public void UnLoad()
        {
            Singleton = null;

            EventManager.UnregisterEvents(this);
        }
    }
}
